var url1 = "ws://localhost:8080/test?id=1&name=值班室1";
var client1 = new WebSocketClient();
client1.init(url1);
client1.connect();
client1.onmessage = function onMessage1(data) {
    var messageBox = window.document.getElementById("messageBox");
    messageBox.innerHTML = "<div>" + data + "</div>" + messageBox.innerHTML;
}



function sendMessage1() {
    if (client1.enable) {
        client1.send("{\"cmd\":\"hello\",\"body\":\"1212\"}")
    } else {
        alert("未连接不能发送")
    }
}

/*var url2 = "ws://localhost:8080/mobile?id=1&name=移动勤务1";
var client2 = new WebSocketClient();
client2.init(url2);
client2.connect();
function sendMessage2() {
    if (client2.enable) {
        client2.send("{\"cmd\":\"hello\",\"body\":\"1212\"}")
    } else {
        alert("未连接不能发送")
    }
}
*/